# ****************************************************************************
# Manage all service projects by cmake,
# and configurate some common cmake options for them.
# ****************************************************************************



cmake_minimum_required(VERSION 3.5)


include("${CMAKE_SOURCE_DIR}/cmake/Utils.cmake" OPTIONAL RESULT_VARIABLE UTILS_CMAKE_FILE)
# message(STATUS "UTILS_CMAKE_FILE:  \"${UTILS_CMAKE_FILE}\"")

if(UTILS_CMAKE_FILE)
    SUBDIRLIST(COMMON_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}")

    foreach(COMMON_NAME ${COMMON_DIRECTORIES})
        # message(${COMMON_NAME})
        if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${COMMON_NAME}/CMakeLists.txt")
            add_subdirectory("${COMMON_NAME}")
        endif()
    endforeach()
endif()